﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:nczc='clr-namespace:NczControlLibrary.Controls'>
    <Style TargetType="nczc:NczEditor">
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Background" Value="#FFFFFFFF" />
        <Setter Property="Foreground" Value="#FF000000" />
        <Setter Property="Padding" Value="2" />
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFA3AEB9" Offset="0"/>
                    <GradientStop Color="#FF8399A9" Offset="0.375"/>
                    <GradientStop Color="#FF718597" Offset="0.375"/>
                    <GradientStop Color="#FF617584" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="nczc:NczEditor">
                    <Grid x:Name="root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" To="#FF99C1E2" Duration="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ReadOnly" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity" To="0" Duration="0"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name='rightmune'>
                                <VisualState x:Name='show'>
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration='0' Storyboard.TargetName='pop' Storyboard.TargetProperty='Visibility'>
                                            <DiscreteObjectKeyFrame KeyTime='0' Value='Visible'/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration='0' Storyboard.TargetName='pop' Storyboard.TargetProperty='IsOpen'>
                                            <DiscreteObjectKeyFrame KeyTime='0' Value='true'/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name='hide'>
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration='0' Storyboard.TargetName='pop' Storyboard.TargetProperty='Visibility'>
                                            <DiscreteObjectKeyFrame KeyTime='0' Value='Collapsed'/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration='0' Storyboard.TargetName='pop' Storyboard.TargetProperty='IsOpen'>
                                            <DiscreteObjectKeyFrame KeyTime='0' Value='false'/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>                                    
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1" Opacity="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
                            <Border x:Name="MouseOverBorder" BorderThickness="1" BorderBrush="Transparent">
                                <ScrollViewer x:Name="ContentElement" Padding="{TemplateBinding Padding}" BorderThickness="0" IsTabStop="False" />
                            </Border>
                        </Border>
                        <Border x:Name="DisabledVisualElement" Background="#A5F7F7F7" BorderBrush="#A5F7F7F7" BorderThickness="{TemplateBinding BorderThickness}" Opacity="0" IsHitTestVisible="False"/>
                        <Border x:Name="FocusVisualElement" BorderBrush="#FF6DBDD1" BorderThickness="{TemplateBinding BorderThickness}" Margin="1" Opacity="0" IsHitTestVisible="False"/>
                        <!--右菜-->
                        <Popup Visibility='Collapsed' Name='pop'>
                            <StackPanel Background='Azure' Opacity='.82' >
                                <HyperlinkButton Padding='8,1' HorizontalContentAlignment='Center' VerticalContentAlignment='Center'>
                                    <HyperlinkButton.ContentTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation='Horizontal'>
                                                <Path Margin='0,0,8,0' Fill='OrangeRed' Stretch='Uniform' Width='15' Height='15' Data='M17.690838,3.1890037C9.5437315,3.1851037 3.7613207,6.0925651 3.764001,7.170742 3.7640007,8.2540588 9.5425118,11.1565 17.690838,11.163 25.836654,11.1565 31.614996,8.2540588 31.614996,7.170742 31.620296,6.0925651 25.835356,3.1851037 17.690838,3.1890037z M17.691336,0C28.82403,0,35.740665,3.6679957,35.365467,6.6445765L31.615503,37.517162C31.464704,38.71907 25.837158,42.6604 17.691336,42.667 9.5430029,42.6604 3.9154869,38.71907 3.764488,37.517162L0.014526135,6.6445765C-0.36059251,3.6679957,6.5559714,0,17.691336,0z'/>
                                                <TextBlock Text='清除'/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </HyperlinkButton.ContentTemplate>
                                </HyperlinkButton>
                                <HyperlinkButton Padding='8,1' HorizontalContentAlignment='Center' VerticalContentAlignment='Center'>
                                    <HyperlinkButton.ContentTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation='Horizontal'>
                                                <Path Margin='0,0,8,0' Fill='Goldenrod' Stretch='Uniform' Width='15' Height='15' Data='M13.148057,38.590011C11.547809,38.593098 9.826211,39.169647 8.3375816,40.326931 5.2634029,42.717567 4.3454037,46.678364 6.2874784,49.176994 8.2287645,51.674431 12.29505,51.760227 15.368549,49.370991 18.442647,46.980553 19.360517,43.01836 17.418581,40.520927 16.417528,39.233292 14.851549,38.586727 13.148057,38.590011z M50.851149,38.589008C49.147512,38.585869 47.581539,39.232803 46.580563,40.520542 44.638374,43.018181 45.55637,46.980694 48.63065,49.371323 51.704233,51.760754 55.770609,51.673649 57.711897,49.177315 59.653387,46.678478 58.735392,42.717361 55.662508,40.326534 54.173403,39.168571 52.451534,38.591957 50.851149,38.589008z M49.814735,33.580021C52.695749,33.585445 55.795462,34.623585 58.47648,36.708073 64.01029,41.010132 65.662558,48.143124 62.166418,52.639282 58.670477,57.135441 51.350901,57.292946 45.817093,52.989586 44.087624,51.644756 42.737247,50.023605 41.804619,48.292953L41.63036,47.952343 33.748492,40.070358 39.836317,33.982387 42.3228,36.71719 42.328268,36.814003 42.476124,36.635914C44.282145,34.597755,46.939531,33.574612,49.814735,33.580021z M31.989048,26.382999C30.228731,26.382999 28.800998,27.811434 28.800999,29.571649 28.800998,31.332067 30.228731,32.758999 31.989048,32.758999 33.749964,32.758999 35.176996,31.332067 35.176996,29.571649 35.176996,27.811434 33.749964,26.382999 31.989048,26.382999z M52.402304,0C57.348917,11.213562,47.345585,22.97518,47.345585,22.97518L22.370607,47.950378 22.195338,48.292953C21.262684,50.023605 19.912274,51.644756 18.182756,52.989586 12.649096,57.292946 5.3286695,57.135441 1.8332748,52.639282 -1.6626987,48.143124 -0.0097904205,41.010132 5.5240488,36.708073 8.2045116,34.623588 11.304072,33.585445 14.185079,33.580021 17.060278,33.574612 19.717805,34.597755 21.523859,36.635914L21.670887,36.813003 21.676301,36.717186 24.974512,33.089611C25.194413,25.83316,27.997223,24.56887,27.997223,24.56887z M11.596984,0L30.25674,18.785181 26.451563,22.616035C25.506781,23.252958,23.779905,24.924812,22.952814,28.926418L22.896383,29.218088 16.653569,22.975181C16.65357,22.975181,6.6496477,11.213563,11.596984,0z'/>
                                                <TextBlock Text='剪切'/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </HyperlinkButton.ContentTemplate>
                                </HyperlinkButton>
                                <HyperlinkButton Padding='8,1' HorizontalContentAlignment='Center' VerticalContentAlignment='Center'>
                                    <HyperlinkButton.ContentTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation='Horizontal'>
                                                <Path Margin='0,0,8,0' Fill='DarkBlue' Stretch='Uniform' Width='15' Height='15' Data='M31.687001,23.116L31.687001,31.394341C31.687001,31.394341,31.526705,36.832023,25.52624,36.359949L18.506,36.388395 18.506,49.587002 18.506001,54.153999 18.506,59.292614C18.506,59.812107,18.929218,60.233997,19.448625,60.233997L45.808704,60.233997C46.326101,60.233997,46.749998,59.812107,46.749998,59.292614L46.749998,24.057384C46.749998,23.539322,46.326101,23.116,45.808704,23.116z M20.552001,4.5669994L20.552001,14.60861C20.552001,14.60861,20.358706,21.203206,13.080177,20.631915L4.565999,20.665694 4.565999,48.4459C4.566,49.076302,5.0797424,49.587002,5.7100554,49.587002L14.742001,49.587002 14.742001,35.400336 18.161097,31.792807 18.166127,31.774705 26.474542,22.972 26.521163,22.972 29.953973,19.349999 38.822001,19.349999 38.822001,5.7076302C38.822001,5.0806808,38.309198,4.5669994,37.680792,4.5669994z M18.449971,0L37.680651,0C40.833681,0,43.391001,2.5571156,43.391001,5.707489L43.391001,19.349999 45.80884,19.349999C48.409018,19.35,50.517,21.458894,50.517,24.05704L50.517,59.292992C50.517,61.893593,48.409018,64,45.80884,64L19.448812,64C16.849223,64,14.742,61.893593,14.742001,59.292992L14.742001,54.153999 5.709774,54.153999C2.555994,54.153999,0,51.599316,0,48.445534L0,19.465691 4.1473293,15.090039 4.1532602,15.068708 14.229262,4.3929996 14.286199,4.3929996z'/>
                                                <TextBlock Text='复制'/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </HyperlinkButton.ContentTemplate>
                                </HyperlinkButton>
                                <HyperlinkButton Padding='8,1' HorizontalContentAlignment='Center' VerticalContentAlignment='Center'>
                                    <HyperlinkButton.ContentTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation='Horizontal'>
                                                <Path Margin='0,0,8,0' Fill='Blue' Stretch='Uniform' Width='15' Height='15' Data='M31.948999,57.859001L45.188999,57.859001 45.188999,59.699001 31.948999,59.699001z M31.948999,51.950001L45.188999,51.950001 45.188999,53.791 31.948999,53.791z M28.396044,35.408001C28.009256,35.408001,27.689001,35.726357,27.689001,36.116974L27.689001,62.648006C27.689001,63.039406,28.009256,63.357002,28.396044,63.357002L48.248085,63.357002C48.638691,63.357002,48.957001,63.039406,48.957001,62.648006L48.957001,45.402447 43.671608,45.381203C39.153995,45.736,39.033001,41.642223,39.033001,41.642223L39.033001,35.408001z M28.395853,32.571999L40.336986,32.571999 42.92213,35.299999 42.958431,35.299999 49.212662,41.928822 49.216327,41.942017 51.790001,44.657917 51.790001,62.648022C51.790001,64.605804,50.204025,66.191002,48.247158,66.191002L28.395853,66.191002C26.438854,66.191002,24.853,64.605804,24.853,62.648022L24.853,36.116901C24.853,34.16061,26.438854,32.571999,28.395853,32.571999z M23.4165,2.7189999C21.472765,2.7190001 19.896,4.211246 19.896,6.0526261 19.896,7.8918042 21.472765,9.3859997 23.4165,9.3859997 25.360433,9.3859997 26.936998,7.8918042 26.936998,6.0526261 26.936998,4.211246 25.360433,2.7190001 23.4165,2.7189999z M23.4165,0C26.836176,0,29.627563,2.5418639,29.798687,5.7406974L29.806993,6.0519996 35.229999,6.0519996 35.229999,7.9879994 46.833999,7.9879994 46.833999,34.156097 41.895698,28.945999 41.695999,28.945999 41.695999,14.389 35.229999,14.389 35.229999,20.865 11.604001,20.865 11.604001,14.389 5.136998,14.389 5.136998,59.294998 21.228,59.294998 21.228,62.648151C21.228,63.142387,21.27823,63.625092,21.373855,64.091423L21.431106,64.338997 0,64.338997 0,7.9879994 11.604001,7.9879994 11.604001,6.0519996 17.026007,6.0519996 17.034315,5.7406974C17.205442,2.5418639,19.996919,0,23.4165,0z'/>
                                                <TextBlock Text='粘贴'/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </HyperlinkButton.ContentTemplate>
                                </HyperlinkButton>
                                <StackPanel.Effect>
                                    <DropShadowEffect ShadowDepth='1'/>
                                </StackPanel.Effect>
                            </StackPanel>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
